<style>
    .desc textarea{width:300px;height:100px;}
    .input label.error{position:inherit}
</style>
<div class="center">
	<div class="home">
    	<div class="home_left">
        	<?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
    	<div class="home_right">
			<div class="replacerechargetop">
            	<i>代支付服务</i>
                <div class="replacerechargetname">
                	<h1>代支付服务</h1>
                    <p>身在海外无法对支付平台进行充值，悠奇代支付服务为您解决烦恼。</p>
                </div>
            </div>
			<div class="replacerechargetab">
            	<ul>
                	<li class="tabon"><a class="tab1" href="#"><i></i>申请代支付</a></li>
                	<li><a class="tab2" href="/member/agentpaylist"><i></i>我的代支付记录</a></li>
                </ul>
            </div>
            
            <div class="apply">
                <form id="form1" action="" method="post">
                <div class="applytable">
                	<table>
                    	<tr>
                        	<td class="z">代支付类型：</td>
                            <td>
                                <label><input class="paytype" type="radio" checked="checked" value="2" name="paytype"> 淘宝代支付</label>&nbsp;&nbsp;
                                <label><input class="paytype" type="radio" value="1" name="paytype"> 货到付款</label>
                                    
                            </td>
                        </tr>
                    	<tr id="order_code" style="display:none">
                        	<td class="z">订单号/物流单号：</td>
                            <td>
                            	<div class="input sm">
                                    <?= $this->formText('code',null,array('class'=>'')) ?><span>请输入正确,将作为我们为您支付订单依据</span>
                                </div>
                            </td>
                        </tr>
                        <tr id="pay_link">
                        	<td class="z">代支付链接：</td>
                            <td>
                            	<div class="input sm">
                                    <?= $this->formText('payurl',null,array('class'=>'required url')) ?>
                                </div>
                            </td>                            
                        </tr>
                    	<tr>
                        	<td class="z">订单金额：</td>
                            <td>
                            	<div class="input jine">
                                	<?= $this->formText('money',NULL,array('class'=>'sm required number','max'=>'2000')) ?><span>元</span>
                                </div>
                            </td>
                        </tr>
                    	<tr>
                        	<td class="z">说明：</td>
                            <td class="desc">
                                <?= $this->formTextarea('remark',null,array('rows'=>4,'maxlength'=>255)) ?>
                            </td>
                        </tr>

                    </table>
                    <div class="payjiner">
                    	<h2>本次代支付服务应付款：</h2>
                        <p><label id="chargeMsg"><span id="omoney">0</span>元 + 2元(服务费) = </label><span id="totalMoney">2</span>元</p>
                        <p style="color:red">注意:悠奇会对请求资金进行财务审查,悠奇有权对有风险的代支付进行拒付,并退款。普通会员每周最多可代支付2000元.</p>
                    </div>
                    <div class="submit">
                    	<a class="next" href="#"><span>下一步</span></a>
                    </div>
                </div>
                </form>
                <div class="applyask">
                	<div class="askname">
                    	<h2>使用遇到的问题</h2>
                    </div>
                    <ul>
                    	<li><a href="http://help.uuch.com/?p=142" target="_blank">1. 代充值申请成功后需要等待多久？</a></li>
                    	<li><a href="http://help.uuch.com/?p=144" target="_blank">2. 为什么需要代充值服务？</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<?php if($this->ma == 1) { ?>
<div class="tanchuang" style="height: 300px;">
    <div class="nui-msgbox">
        <div class="nui-msgbox-hd" style="font-size: 16px;">系统消息</div>
        <a class="nui-msgbox-close" title="关闭"><b></b></a>
    </div>
    <div class="wenti_box">
        <div style="margin-left: 20px;font-size: 16px;margin-top: 20px;width: 560px;">
            <h3>尊敬的会员：</h3>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对不起，您的代支付提交不成功。 您的VIP等级没有达到可以提交代支付的等级。</p>
            <p style="margin-top: 20px;margin-left: 150px;"><a href="javascript:void(0)" class="exitproblem" ><span class="countdown">10</span>秒后自动关闭，立即关闭。</a></p>
        </div>
    </div>
</div>
<div class="houtai_overlay"></div>
<script>
    var leftSeconds = 10;
    setInterval("CountDown()", 1000);
    $(".nui-msgbox-close").click(function(){
        $("div.houtai_overlay").hide();
        $("div.tanchuang").hide();
    });
    $(".exitproblem").click(function(){
        $("div.houtai_overlay").hide();
        $("div.tanchuang").hide();
    }); 
    function CountDown() {
        if(leftSeconds<=0){
            $(".exitproblem").click();
        }
        leftSeconds--;
        $(".countdown").html(leftSeconds);
    }
</script>
<?php }?>
<script type="text/javascript">
$(function(){
    $('form').validate();
    $('.submit .next').click(function(){
        $('form').submit();
        return false;
    })
    $('#money').change(function(){
        $('#omoney').text($(this).val());
        $('#totalMoney').text(parseFloat($(this).val())+2 );
    });
    $('.paytype').change(function(){
        var val = $('.paytype:checked').val();
        if(val==1){
            $('#order_code').show();
            $('#pay_link').hide();
            $('#code').addClass('required');
            $('#payurl').removeClass('required');
        }else{
            $('#order_code').hide();
            $('#pay_link').show();            
            $('#code').removeClass('required');
            $('#payurl').addClass('required');
        }
    });
});
</script>